package com.speily;

import com.speily.observer.Observer;
import com.speily.observer.ObserverJack;
import com.speily.observer.ObserverTim;
import com.speily.subject.Teacher;

/**
 * @Auther: SPL
 * @Date: 2019-07-03 14:52
 * @Description: 使用
 */
public class Client {

    public static void main(String[] args) {

        // 老师 ----被观察者
        Teacher teacher = new Teacher();

        // jack ---观察者
        Observer observer1 = new ObserverJack();

        teacher.attach(observer1);

        // Tim--观察者
        Observer observer2 = new ObserverTim();
        // 登记观察者
        teacher.attach(observer2);

        // 老师布置作业
        teacher.homework("--------------老师留作业了");

    }

}
